
<!-- Start of first page -->
<div
	data-role="page">
	<div data-role="header" data-theme="b">
		<a href="#" data-icon="back" onclick="history.go(-1);">返回</a>
		<?php if(empty($id)):?>
		<h1>
			<?php echo Yii::app()->user->name?> - 评论
		</h1>
		<?php else:?>
		<h1>
			<?php if(UserIdentity::getUserDetail($id)->nickname==null):?>
				<?php echo $username?>的帖子
			<?php else:?>
				<?php echo UserIdentity::getUserDetail($id)->nickname?>的评论
			<?php endif?>
		</h1>
		<?php endif?>
		<?php echo CHtml::link("用户",array("user/index"),array("data-icon"=>"star"))?>
	</div>
	<!-- /header -->

	<div data-role="content">

	<?php if(count($posts) == 0):?>
	<?php if(empty($id)):?>
		<div class="ui-body ui-body-e">
			<h4>您未在新闻页留过言</h4>
			<?php echo CHtml::link("新闻首页",array("news/index"),array("data-role"=>"button","data-icon"=>"home","data-theme"=>"b"))?>
		</div>
	<?php else:?>
		<div class="ui-body ui-body-e">
			<p>您搜索的这位少侠很懒，还未发表过任何评论。。</p>
		</div>
	<?php endif?>

	<?php else:?>
		<ul data-role="listview"data-theme="d">
			<li>
				<div class="tie-list-top">系统仅显示最新的20条评论</div>
			</li>
			<?php $n=0;?>
			<?php foreach($posts as $post):?>
			<?php $n++;?>
			<li><a rel='external' href="<?php echo Yii::app()->createUrl('news/view', array('id'=>$post->topic_id)); ?> ">	
					<div class="tie-body-content">
						<?php echo strip_tags($post->content);?>
					</div>
					<div class="ui-grid-a tie-list-footer">
						<div class="ui-block-a">评论<?php echo $n;?></div>
						<div class="ui-block-b" style ="text-align:right"><?php echo mb_substr($post->created,0,16,"UTF-8");?></div>
					</div><!-- /grid-a -->
			</a></li>
			<?php endforeach?>
		</ul>
		<?php endif?>
	</div>
	<!--/content-primary -->

	<?php $this->renderPartial("//site/footer")?>
	<!-- /footer -->
	
</div>
<!-- /page -->
